
import 'package:ysy_flutter_mvvm_yuanxuan/bean/base/BaseBean.dart';

class SubitOrderBean extends BaseJsonBean{
  String?  askPrice;
  List<ConfirmOrderItems>? confirmOrderItems;
  MemberReceiveAddress? memberReceiveAddress;
  String?  agreementUrl;
  int?  isAskPriceFlag;

  SubitOrderBean(
      {this.askPrice,
      this.confirmOrderItems,
      this.memberReceiveAddress,
      this.agreementUrl,
      this.isAskPriceFlag});

  SubitOrderBean.fromJson(Map<String, dynamic> json) {
    askPrice = json['askPrice'];
    if (json['confirmOrderItems'] != null) {
      confirmOrderItems = [];
      json['confirmOrderItems'].forEach((v) {
        confirmOrderItems?.add(new ConfirmOrderItems.fromJson(v));
      });
    }
    memberReceiveAddress = json['memberReceiveAddress'] != null
        ? new MemberReceiveAddress.fromJson(json['memberReceiveAddress'])
        : null;
    agreementUrl = json['agreementUrl'];
    isAskPriceFlag = json['isAskPriceFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['askPrice'] = this.askPrice;
    if (this.confirmOrderItems != null) {
      data['confirmOrderItems'] =
          this.confirmOrderItems?.map((v) => v.toJson()).toList();
    }
    if (this.memberReceiveAddress != null) {
      data['memberReceiveAddress'] = this.memberReceiveAddress?.toJson();
    }
    data['agreementUrl'] = this.agreementUrl;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    return data;
  }
}

class MemberReceiveAddress {
  int? id;
  String? memberId;
  String? name;
  String? phoneNumber;
  int? defaultStatus;
  String? province;
  String? city;
  String? region;
  String? detailAddress;
  String? tag;

  MemberReceiveAddress(
      {this.id,
        this.memberId,
        this.name,
        this.phoneNumber,
        this.defaultStatus,
        this.province,
        this.city,
        this.region,
        this.detailAddress,
        this.tag});

  MemberReceiveAddress.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    memberId = json['memberId'];
    name = json['name'];
    phoneNumber = json['phoneNumber'];
    defaultStatus = json['defaultStatus'];
    province = json['province'];
    city = json['city'];
    region = json['region'];
    detailAddress = json['detailAddress'];
    tag = json['tag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['memberId'] = this.memberId;
    data['name'] = this.name;
    data['phoneNumber'] = this.phoneNumber;
    data['defaultStatus'] = this.defaultStatus;
    data['province'] = this.province;
    data['city'] = this.city;
    data['region'] = this.region;
    data['detailAddress'] = this.detailAddress;
    data['tag'] = this.tag;
    return data;
  }
}

class ConfirmOrderItems {
  String?  storeId;
  String?  storeName;
  List<CheckProducts>? checkProducts;
  StoreWhAddr? storeWhAddr;
  String?  customerReservationNumber;
  int?  isInviteAgreement;

  ConfirmOrderItems(
      {this.storeId,
      this.storeName,
      this.checkProducts,
      this.storeWhAddr,
      this.customerReservationNumber,
      this.isInviteAgreement});

  ConfirmOrderItems.fromJson(Map<String, dynamic> json) {
    storeId = json['storeId'];
    storeName = json['storeName'];
    if (json['checkProducts'] != null) {
      checkProducts = [];
      json['checkProducts'].forEach((v) {
        checkProducts?.add(new CheckProducts.fromJson(v));
      });
    }
    storeWhAddr = json['storeWhAddr'] != null
        ? new StoreWhAddr.fromJson(json['storeWhAddr'])
        : null;
    customerReservationNumber = json['customerReservationNumber'];
    isInviteAgreement = json['isInviteAgreement'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['storeId'] = this.storeId;
    data['storeName'] = this.storeName;
    if (this.checkProducts != null) {
      data['checkProducts'] =
          this.checkProducts?.map((v) => v.toJson()).toList();
    }
    if (this.storeWhAddr != null) {
      data['storeWhAddr'] = this.storeWhAddr?.toJson();
    }
    data['customerReservationNumber'] = this.customerReservationNumber;
    data['isInviteAgreement'] = this.isInviteAgreement;
    return data;
  }
}

class CheckProducts {
  String?  askPrice;
  int?  cartId;
  String?  productId;
  String?  productName;
  String?  skuCode;
  String?  productAttr;
  String?  productPic;
  int?  quantity;
  double?  totalProductPrice;
  String?  productType;
  int?  isAskPriceFlag;
  String?  unit;

  CheckProducts(
      {this.askPrice,
      this.cartId,
      this.productId,
      this.productName,
      this.skuCode,
      this.productAttr,
      this.productPic,
      this.quantity,
      this.totalProductPrice,
      this.productType,
      this.isAskPriceFlag,
      this.unit});

  CheckProducts.fromJson(Map<String, dynamic> json) {
    askPrice = json['askPrice'];
    cartId = json['cartId'];
    productId = json['productId'];
    productName = json['productName'];
    skuCode = json['skuCode'];
    productAttr = json['productAttr'];
    productPic = json['productPic'];
    quantity = json['quantity'];
    totalProductPrice = json['totalProductPrice'];
    productType = json['productType'];
    isAskPriceFlag = json['isAskPriceFlag'];
    unit = json['unit'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['askPrice'] = this.askPrice;
    data['cartId'] = this.cartId;
    data['productId'] = this.productId;
    data['productName'] = this.productName;
    data['skuCode'] = this.skuCode;
    data['productAttr'] = this.productAttr;
    data['productPic'] = this.productPic;
    data['quantity'] = this.quantity;
    data['totalProductPrice'] = this.totalProductPrice;
    data['productType'] = this.productType;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    data['unit'] = this.unit;
    return data;
  }
}

class StoreWhAddr {
  int?  id;
  String?  addressId;
  String?  corpId;
  String?  storeId;
  String?  address;
  String?  defaultStatus;
  String?  postCode;
  String?  province;
  String?  city;
  String?  detailAddress;
  double? loLgt;
  double? loLtt;
  String?  ctcUser;
  String?  phoneNumber;
  String?  crtTime;
  String?  crtUser;
  String?  updateTime;
  int?  isDelete;
  String?  storeName;

  StoreWhAddr(
      {this.id,
      this.addressId,
      this.corpId,
      this.storeId,
      this.address,
      this.defaultStatus,
      this.postCode,
      this.province,
      this.city,
      this.detailAddress,
      this.loLgt,
      this.loLtt,
      this.ctcUser,
      this.phoneNumber,
      this.crtTime,
      this.crtUser,
      this.updateTime,
      this.isDelete,
      this.storeName});

  StoreWhAddr.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    addressId = json['addressId'];
    corpId = json['corpId'];
    storeId = json['storeId'];
    address = json['address'];
    defaultStatus = json['defaultStatus'];
    postCode = json['postCode'];
    province = json['province'];
    city = json['city'];
    detailAddress = json['detailAddress'];
    loLgt = json['loLgt'];
    loLtt = json['loLtt'];
    ctcUser = json['ctcUser'];
    phoneNumber = json['phoneNumber'];
    crtTime = json['crtTime'];
    crtUser = json['crtUser'];
    updateTime = json['updateTime'];
    isDelete = json['isDelete'];
    storeName = json['storeName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['addressId'] = this.addressId;
    data['corpId'] = this.corpId;
    data['storeId'] = this.storeId;
    data['address'] = this.address;
    data['defaultStatus'] = this.defaultStatus;
    data['postCode'] = this.postCode;
    data['province'] = this.province;
    data['city'] = this.city;
    data['detailAddress'] = this.detailAddress;
    data['loLgt'] = this.loLgt;
    data['loLtt'] = this.loLtt;
    data['ctcUser'] = this.ctcUser;
    data['phoneNumber'] = this.phoneNumber;
    data['crtTime'] = this.crtTime;
    data['crtUser'] = this.crtUser;
    data['updateTime'] = this.updateTime;
    data['isDelete'] = this.isDelete;
    data['storeName'] = this.storeName;
    return data;
  }
}
